package com.wwp.info;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

/**
 * 
 *
 * class name: NetHelper
 * description:
 * authername:wangwenping
 * modified by: xx 
 * modified time:2015-10-21 下午5:56:00
 * modified info :
 * @version 1.0.0
 *
 */
public class NetHelper {

	public static boolean IsHaveInternet(final Context context) {
		try {
			ConnectivityManager manger = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
			NetworkInfo info = manger. getActiveNetworkInfo();
			return (info != null && info.isConnected() && info.isAvailable());
		} catch (Exception e) {
			return false;
		}
	}

}
